package cn.iocoder.yudao.module.ordering.dal.mysql;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.ordering.dal.dataobject.ThirdPartyMemberDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 第三方会员信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ThirdPartyMemberMapper extends BaseMapperX<ThirdPartyMemberDO> {

    default ThirdPartyMemberDO selectByThirdPartyMemberId(String thirdPartyMemberId) {
        return selectOne(new LambdaQueryWrapperX<ThirdPartyMemberDO>()
                .eq(ThirdPartyMemberDO::getThirdPartyMemberId, thirdPartyMemberId));
    }

    default ThirdPartyMemberDO selectByMobile(String mobile) {
        return selectOne(new LambdaQueryWrapperX<ThirdPartyMemberDO>()
                .eq(ThirdPartyMemberDO::getMobile, mobile));
    }

    default ThirdPartyMemberDO selectByUsername(String username) {
        return selectOne(new LambdaQueryWrapperX<ThirdPartyMemberDO>()
                .eq(ThirdPartyMemberDO::getUsername, username));
    }

    default ThirdPartyMemberDO selectByMercantId(String mercantId) {
        return selectOne(new LambdaQueryWrapperX<ThirdPartyMemberDO>()
                .eq(ThirdPartyMemberDO::getMercantId, mercantId));
    }

}

